package com.itheima.web;

import com.itheima.entity.Result;
import com.itheima.service.MemberService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
public class MemberController {

    @Reference
    private MemberService memberService;

    //查询一年的会员数据
    @GetMapping("/findAmounByYear")
    public Result findAmounByYear(){
        return new Result(memberService.findAmounByYear());
    }

    @GetMapping("/findDate/{start}/{end}")
    public Result findDate(@PathVariable("start") String start, @PathVariable("end")String end){

        return new Result(memberService.findDate(start,end));
    }


}
